package com.minhnvt1.twitterclient;

import android.app.Activity;
import android.os.Bundle;
import android.os.Handler;
import android.webkit.WebView;

public class TwitterclientActivity extends Activity {
    WebView webView;
    private Handler handler;
    private static final String JAVASCRIPT = "javascript";
	private static final String BRC = "()";
	private static final String BRC_OPEN = "(";
	private static final String BRC_CLOSE = ")";
	
	private static final String Q = "?";
	private static final String HTML_ROOT = "file:///android_asset/www/";
	
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        webView = new WebView(this);
        
        setContentView(webView);
        handler = new Handler();
        webView.getSettings().setJavaScriptEnabled(true);
        loadPage("index.php");
    }
    public void loadPage(String fileName) {
    	final String url = HTML_ROOT + fileName;
    	loadURL(url);
    }
    public void loadURL(final String url) {
    	handler.post(new Runnable() {
			
			@Override
			public void run() {
				webView.loadUrl(url);
				
			}
		});
    }
    
}